package com.cn.study008;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Test8003.java
 * @Description
 * @createTime 2023年05月14日 18:03:00
 */
public class Test8003 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        double[] de=new double[5];
        double sum=0;
        System.out.println("请输入本月的消费记录");
        for (int i = 0; i < de.length; i++) {
            System.out.print("请输入第"+(i+1)+"笔购物金额：");
            de[i]=sc.nextDouble();
        }
        System.out.println("\n序号\t\t\t金额（元）");
        for (int i = 0; i < de.length; i++) {
            System.out.println((i+1)+"\t\t\t"+de[i]);
            sum+=de[i];
        }
        System.out.println("总金额\t\t"+sum);
    }
}
